package com.wwj.study.adapter.pay;

import java.util.HashMap;

/**
 * @Author: wuweijun
 * @Date: 2018/11/24 20:44
 */
public class PayStrategy {

    private static HashMap<String,IPay> hashMap=new HashMap<>();

    static {
        hashMap.put("weixin",new WeiXinAdapter(new WeiXin()));
        hashMap.put("ali",new AliAdapter(new Ali()));
    }

    public static IPay createPayAdapter(String type){
        return hashMap.get(type);
    }
}
